Skip to content

Conversation

@angelbarrera92
Copy link
Contributor

@angelbarrera92 angelbarrera92 commented Sep 29, 2025

Fixes #1827

@angelbarrera92 angelbarrera92 force-pushed the issue-1827 branch 2 times, most recently from 8f9ee1a to 174dafa Compare September 29, 2025 17:36
@angelbarrera92 angelbarrera92 changed the title #1827: FIX: A MetricTemplate reference without a namespace does not default to the Canary namespace fix: default namespace for cross-namespace ref validation Sep 29, 2025
@stefanprodan
Copy link
Member

@angelbarrera92 can you please rebase with upstream main and force push

When cross-namespace references are disabled, ensure that UpstreamRef,
MetricTemplateRef, and AlertProviderRef default to the canary's namespace
if their namespace field is empty. This aligns the validation logic with
the rest of the controller and prevents false positives when the namespace
is omitted.

Fixes fluxcd#1827

Signed-off-by: Barrera, Angel <[email protected]>
@angelbarrera92
Copy link
Contributor Author

@angelbarrera92 can you please rebase with upstream main and force push

Done

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.95%. Comparing base (12ee6cb) to head (eeeac35).
⚠️ Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controller/controller.go 75.00% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1828       +/-   ##
===========================================
- Coverage   39.44%   28.95%   -10.49%     
===========================================
  Files         287      287               
  Lines       22706    22891      +185     
===========================================
- Hits         8956     6629     -2327     
- Misses      12777    15537     +2760     
+ Partials      973      725      -248     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @angelbarrera92 🏅

@stefanprodan stefanprodan merged commit 5c481cd into fluxcd:main Oct 8, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A MetricTemplate reference without a namespace does not default to the Canary namespace

3 participants